home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / LEDIT108.ZIP / LEMFC / LEMFC_1F.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-25  |  2.3 KB  |  106 lines

  1. #include "stdafx.h"
  2. #include "lemfc_1.h"
  3. #include "lemfc_1f.h"
  4.  
  5. #ifdef _DEBUG
  6. #undef THIS_FILE
  7. static char BASED_CODE THIS_FILE[] = __FILE__;
  8. #endif
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMainFrame
  12.  
  13. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  14.  
  15. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  16.     //{{AFX_MSG_MAP(CMainFrame)
  17.         // NOTE - the ClassWizard will add and remove mapping macros here.
  18.         //    DO NOT EDIT what you see in these blocks of generated code !
  19.     ON_WM_CREATE()
  20.     //}}AFX_MSG_MAP
  21. END_MESSAGE_MAP()
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // arrays of IDs used to initialize control bars
  25.     
  26. // toolbar buttons - IDs are command buttons
  27. static UINT BASED_CODE buttons[] =
  28. {
  29.     // same order as in the bitmap 'toolbar.bmp'
  30.     ID_FILE_NEW,
  31.     ID_FILE_OPEN,
  32.     ID_FILE_SAVE,
  33.     ID_SEPARATOR,
  34.     ID_EDIT_CUT,
  35.     ID_EDIT_COPY,
  36.     ID_EDIT_PASTE,
  37.     ID_SEPARATOR,
  38.     ID_FILE_PRINT,
  39.     ID_APP_ABOUT,
  40. };
  41.  
  42. static UINT BASED_CODE indicators[] =
  43. {
  44.     ID_SEPARATOR,           // status line indicator
  45.     ID_INDICATOR_CAPS,
  46.     ID_INDICATOR_NUM,
  47.     ID_INDICATOR_SCRL,
  48. };
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CMainFrame construction/destruction
  52.  
  53. CMainFrame::CMainFrame()
  54. {
  55.     // TODO: add member initialization code here
  56.     
  57. }
  58.  
  59. CMainFrame::~CMainFrame()
  60. {
  61. }
  62.  
  63. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  64. {
  65.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  66.         return -1;
  67.     
  68.     if (!m_wndToolBar.Create(this) ||
  69.         !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  70.         !m_wndToolBar.SetButtons(buttons,
  71.           sizeof(buttons)/sizeof(UINT)))
  72.     {
  73.         TRACE0("Failed to create toolbar\n");
  74.         return -1;      // fail to create
  75.     }
  76.  
  77.     if (!m_wndStatusBar.Create(this) ||
  78.         !m_wndStatusBar.SetIndicators(indicators,
  79.           sizeof(indicators)/sizeof(UINT)))
  80.     {
  81.         TRACE0("Failed to create status bar\n");
  82.         return -1;      // fail to create
  83.     }
  84.  
  85.     return 0;
  86. }
  87.  
  88. /////////////////////////////////////////////////////////////////////////////
  89. // CMainFrame diagnostics
  90.  
  91. #ifdef _DEBUG
  92. void CMainFrame::AssertValid() const
  93. {
  94.     CFrameWnd::AssertValid();
  95. }
  96.  
  97. void CMainFrame::Dump(CDumpContext& dc) const
  98. {
  99.     CFrameWnd::Dump(dc);
  100. }
  101.  
  102. #endif //_DEBUG
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CMainFrame message handlers
  106.